package com.java.proxy.staticproxy;

/**
 * @author liyanhao
 * @Date 2023-02-25 13:35
 */
public class Tank2 implements MoveAble {

    @Override
    public void move() {
        System.out.println("tank mv");
    }

    public static void main(String[] args) {
        TankProxy tankProxy = new TankProxy(new Tank2());
        tankProxy.move();
    }

}

class TankProxy implements MoveAble {
    private MoveAble moveAble;

    public TankProxy(MoveAble moveAble) {
        this.moveAble = moveAble;
    }

    @Override
    public void move() {
        System.out.println("添加日志");
        moveAble.move();
        System.out.println("添加日志结束");
    }
}

interface MoveAble{
    void move();
}
